package singleton;

import org.junit.Test;

import java.lang.reflect.Constructor;

public class SingletonTest {

    @Test
    public void test1(){
        DCLSingleton dclSingleton1 = DCLSingleton.getInstance();
        DCLSingleton dclSingleton2 = null;
        try{
            Class<DCLSingleton> clazz = DCLSingleton.class;
            Constructor<DCLSingleton> constructor = clazz.getDeclaredConstructor();
            constructor.setAccessible(true);
            dclSingleton2 = constructor.newInstance();
        }catch (Exception e){
            e.printStackTrace();
        }
        System.out.println(dclSingleton1.hashCode());
        System.out.println(dclSingleton2.hashCode());
    }
}
